<template>
  <div>
    <el-button type="primary" size="default" @click="onIncrement">
      加1
    </el-button>
    <h2>{{ count }}</h2>
  </div>
</template>

<script setup lang="ts">
import { useCountStore } from '../store/count'
import { computed } from 'vue'

const countStore = useCountStore()
const count = computed(() => {
  return countStore.getCount
})
const onIncrement = () => {
  countStore.setCount(++countStore.count)
}
</script>

<style scoped></style>